]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
messageTray: Remove code that happens on notification destruction
authorJasper St. Pierre <jstpierre@mecheye.net>
Fri, 2 Aug 2013 04:09:33 +0000 (00:09 -0400)
committerJasper St. Pierre <jstpierre@mecheye.net>
Fri, 16 Aug 2013 01:52:59 +0000 (21:52 -0400)
js/ui/messageTray.js

index 5ae077161f1a6ab6c5359e4ea8407e5c70aeacbe..4fae78978972deab6f1e9a4e21c5f1362cadc5a1 100644 (file)
@@ -1950,26 +1950,11 @@ const MessageTray = new Lang.Class({
         source.disconnect(obj.destroyId);
         source.disconnect(obj.mutedChangedId);
 
-        let needUpdate = false;
-
-        if (this._notification && this._notification.source == source) {
-            this._updateNotificationTimeout(0);
-            this._notificationRemoved = true;
-            needUpdate = true;
-        }
-        if (this._clickedSummaryItem == summaryItem) {
-            this._setClickedSummaryItem(null);
-            needUpdate = true;
-        }
-
         summaryItem.destroy();
 
         this.emit('source-removed', source);
 
         this._updateNoMessagesLabel();
-
-        if (needUpdate)
-            this._updateState();
     },
 
     getSources: function() {
@@ -2689,6 +2674,10 @@ const MessageTray = new Lang.Class({
 
         if (this._clickedSummaryItem) {
             this._clickedSummaryItem.actor.add_style_pseudo_class('selected');
+            this._clickedSummaryItem.actor.connect('destroy', Lang.bind(this, function() {
+                this._setClickedSummaryItem(null);
+                this._updateState();
+            }));
             this._clickedSummaryItemAllocationChangedId =
                 this._clickedSummaryItem.actor.connect('allocation-changed',
                                                        Lang.bind(this, this._adjustSummaryBoxPointerPosition));